#include <iostream>
#include <fstream>

using namespace std;

int main()
{

    int a =1,b =1 ,c =1;

    while (a<1000)
    {
        while (b<1000)
        {
            while (c<1000)
            {
                if ( (a*a + b*b == c*c) and a + b + c == 1000)  return a * b * c;
                c++;
            }
            b++;
            c = 1;
        }
        b = 1;
        a++;
        cout << a << endl;
    }



}
